package com.xci.xajtfb.bus.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelIgnore;
import com.github.lvyanyang.core.BaseEntity;
import com.github.lvyanyang.core.Const;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;

/**
 * 系统文件
 * @author 张谦 765870682@qq.com
 * @since 2021-03-02 9:40:00
 */
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(description = "系统文件")
public class BaseFile extends BaseEntity implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 * 主键
	 */
	@Length(max = 50, message = "主键长度不能超过{max}")
	@ExcelIgnore
	@Excel(name = "主键", width = 20d)
	@ApiModelProperty(value = "主键", required = true, position = 1)
	private String id;

	/**
	 * 文件名称
	 */
	@NotBlank(message = "请输入文件名称")
	@Length(max = 100, message = "文件名称长度不能超过{max}")
	@Excel(name = "文件名称", width = 20d)
	@ApiModelProperty(value = "文件名称", required = true, position = 2)
	private String name;

	/**
	 * 文件请求类型
	 */
	@Length(max = 200, message = "文件请求类型长度不能超过{max}")
	@Excel(name = "文件请求类型", width = 20d)
	@ApiModelProperty(value = "文件请求类型", position = 3)
	private String contentType;

	/**
	 * 文件路径
	 */
	@NotBlank(message = "请输入文件路径")
	@Length(max = 500, message = "文件路径长度不能超过{max}")
	@Excel(name = "文件路径", width = 20d)
	@ApiModelProperty(value = "文件路径", required = true, position = 4)
	private String virtualUrl;

	/**
	 * 文件大小
	 */
	@NotNull(message = "请输入文件大小")
	@Excel(name = "文件大小", width = 20d)
	@ApiModelProperty(value = "文件大小", required = true, position = 5)
	private Long size;

	/**
	 * 资源主键
	 */
	@NotBlank(message = "请输入资源主键")
	@Length(max = 100, message = "资源主键长度不能超过{max}")
	@ExcelIgnore
	@Excel(name = "资源主键", width = 20d)
	@ApiModelProperty(value = "资源主键", required = true, position = 6)
	private String resId;

	/**
	 * 创建用户主键
	 */
	@Length(max = 50, message = "创建用户主键长度不能超过{max}")
	@ExcelIgnore
	@Excel(name = "创建用户主键", width = 20d)
	@ApiModelProperty(value = "创建用户主键", position = 7)
	private String createUserId;

	/**
	 * 创建用户
	 */
	@Length(max = 50, message = "创建用户长度不能超过{max}")
	@Excel(name = "创建用户", width = 20d)
	@ApiModelProperty(value = "创建用户", position = 8)
	private String createUserName;

	/**
	 * 创建日期
	 */
	@Excel(name = "创建日期", width = 20d, exportFormat = Const.DEFAULT_DATETIME_PATTERN)
	@ApiModelProperty(value = "创建日期", position = 9)
	private Date createDateTime;
}
